Evolution in Feature - Oriented Model - Based Software Product

نویسندگان

  • Christoph Seidl
  • Florian Heidenreich
  • Uwe Aßmann
چکیده

RefactoringAdapter AbstractRefactoringPostProcessor IRefactoringPostProcessor AbstractEvolutionAdapterEvolutionAdapter AbstractSolutionSpaceEvolution AbstractProblemSpaceEvolution AbstractEvolution <>SolutionSpaceEvolution AbstractProblemSpaceEvolution AbstractEvolution <> Using these classes, evolutions are implemented in the Java programming language. However, evolutions in the solution space do not necessarily have to be declared in source code. Alternatively, the generic refactoring mechanism of Refactory can be used to describe the steps of modification declaratively in the refactoring specification. The concrete approach used when implementing a new evolution depends on the complexity of the performed operations. If the evolution is simple enough to be implemented generically using the refactoring specification, this option may be chosen as the abstract specification can then be reused within another context. However, if the performed changes are too complex or require knowledge specific to the target meta model, an evolution should be implemented as sub class of AbstractSolutionSpaceEvolution. The last point is the reason for why there are no generic evolutions in the problem space. Each evolution on the feature tree uses knowledge specific to that type of model. For example, the cardinality and name of an element are modified. Furthermore, the structuring into groups and features is key to many modifications. As a result, the problem space uses evolutions in source code that are subclasses of AbstractProblemSpaceEvolution. The specifics of the implementation for evolutions in either space are left to the respective subsections. It is worth noting that all evolutions can be executed independently of the control flow of Refactory. Each evolution takes the required input values as parameters to its constructor. This avoids misconfiguration due to neglecting to specify required values, which might happen if the parameters were to be set by individual methods. After this configuration, an evolution can be executed directly. This design decision makes evolutions more versatile and allows them to be tested without the need to configure Refactory. However, evolutions can still benefit from the user interface integration and generic refactoring capabilities of Refactory. To integrate them with Refactory, a so called AbstractEvolutionAdapter is required. The adapter class inherits from AbstractRefactoringPostProcesser, which in turn implements the interface IRefactoringPostProcessor. This relation bridges the gap to Refactory so that evolution adapters can be registered to be executed during the control 4.2. IMPLEMENTATION 81 flow of Refactory. The adapter then creates and configures an appropriate evolution, which will be executed. Each adapter is registered as post processor to a concrete refactoring. As explained in the introductory section to Refactory, a concrete refactoring consists of a role model, a generic refactoring specification and a role mapping, which ties the abstract refactoring to a specific metamodel. In the case of problem space evolutions, the concrete refactoring is implemented as dummy consisting of a simple role model, a refactoring specification that merely loads objects of the specified roles but does not perform any modifications and a role mapping to the metamodel of the feature tree. Solution space evolutions may choose to use the same generic refactoring and map it to the targeted solution space metamodel if they want to implement the real evolution in source code. In both these scenarios, the evolution is executed by the evolution adapter registered as post processor. In order to create an evolution, evolution adapters have to convert the parameters received from Refactory into valid parameters for the evolution. For example, it has to be decided, how objects of a role are to be used for the evolution. With these values, the evolution related to the adapter is created. Through this specific configuration process, each evolution adapter is tied to exactly one evolution. Thus, it is necessary to create a pair of evolution and evolution adapter for each modification that should be available through the menu provided by Refactory. A UML diagram displaying a subset of the evolutions and their evolution adapters is shown in Figure 4.3. Figure 4.3: UML diagram showing a subset of the evolutions with their respective evolution adapters. DuplicateFeatureEvolutionAdapter InsertFeatureEvolutionAdapter DuplicateGroupEvolutionAdapter AbstractProblemSpaceEvolution AbstractEvolutionAdapter AbstractDuplicateEvolutionDuplicateEvolution DuplicateFeatureEvolution DuplicateGroupEvolution InsertFeatureEvolution 4.2.1.1 Implementation of Evolutions in the Problem Space All evolutions in the problem space modify the feature tree. Thus, they use the mechanisms provided by Refactory to be available only if suitable elements of the feature tree are selected. For this purpose, a simple role model containing only a single role called “Element” is provided. The refactoring specification merely serves as dummy that loads the objects matching this role. In the role mapping, the “Element” role is then mapped to either a group or a feature. The concrete choice depends on whether an evolution should be triggered for a feature or a group. The only exception is the Insert Feature evolution, which can be executed on features as well 82 CHAPTER 4. A FRAMEWORK FOR EVOLUTIONS IN FEATUREMAPPER as groups. Its specifics will be explained later. The basic class for evolutions in the problem space is AbstractProblemSpaceEvolution. It provides the elementary sequence of method calls that perform an evolution in five steps. It is assumed that all specialized evolution classes take the required configuration values as parameters to their constructor so that all modifications can be performed. First, it is checked whether the preconditions for applying the evolution are met. Second, the modifications to the feature model are performed according to the concrete evolution. After this point, the last three steps will only be performed if it is not a preview run of the evolution used to display preliminary results of the modification in the user interface. In the third step, the remapping for the evolution will be performed by creating a remapping plan, letting users set parameters in the remapping dialog and then executing the plan. As fourth step, the mapping model is saved in order to keep it consistent with the performed modifications. Finally, the user interface is updated to reflect the changes made during the evolution and remapping. In Listing 4.4, an excerpt from AbstractProblemSpaceEvolution in Java source code is shown that reflects these five steps. Listing 4.4: Java source code excerpt from AbstractProblemSpaceEvolution showing the five steps required for problem space evolutions. checkPreconditions(); evolve(); if (!getIsPreviewMode()) { remap(); saveMappingModel(); updateUI(); } The exact operations performed in each of these methods depend on the concrete evolution and are thus implemented in the subclasses of AbstractProblemSpaceEvolution, which will be explained in the following paragraphs. An overview of all concrete evolutions for the problem space is provided in Figure 4.4. The names of the sub classes are chosen in accordance with the names of the evolutions they implement. An explicit mapping between classes and evolutions is thus omitted at this point. Instead, the most noteworthy characteristics of the implementation are presented for all concrete classes. All evolutions for the variation type of features and groups have the common base class AbstractVariationTypeEvolution. Its concrete subclasses implement the evolutions for the variation type presented in Section 3.1.1.1 and Section 3.1.1.9 respectively. Their implementations consist of mere modifications of the minimum and maximum cardinality of the target element. The particular nature of the changes has already been described in the aforementioned sections and the operational details are elementary so that no further explanation is necessary at this point. The Insert Feature evolution is special as it can be triggered when either a feature or a group 4.2. IMPLEMENTATION 83 Figure 4.4: UML diagram of the classes for evolutions in the problem space. RemoveFeatureAndOwnedAssetsEvolution TransformToOptionalFeatureEvolution TransformToMandatoryFeatureEvolution TransformToAlternativeGroupEvolution AbstractVariationTypeEvolution TransformToOrGroupEvolution TransformToAndGroupEvolution AbstractProblemSpaceEvolution RemoveFeatureEvolution DuplicateGroupEvolution PullUpFeatureEvolution InsertFeatureEvolution AbstractDuplicateEvolutionDuplicateEvolution MergeFeaturesEvolution AbstractMergeEvolution SplitFeatureEvolution MergeGroupsEvolution DuplicateFeatureEvolution is selected. Making this possible requires adaptation of the role mapping. The role “Element” from the role model is thus mapped to the class FeatureTreeNode, which is the base class of features as well as groups in the feature tree. A distinction is then made in the source code of the evolution to determine the adequate steps of inserting a feature for the selected tree node. The evolutions Duplicate Feature and Duplicate Group are both capable of copying an entire branch of the feature tree containing not only the selected element but also all of its children and further descendants. Thus, the subsequent remapping needs to be performed for all indirectly copied elements as well. During the course of evolution, both Duplicate Feature and Duplicate Group also copy all references to constraints originating from the original features. Furthermore, the user interface of FeatureMapper is updated in a way that all duplicated elements are selected provided that their original counterparts were selected prior to the evolution. The Split Feature evolution allows users to select into how many parts a feature should be split. Furthermore, names can be provided for all constituent parts. After creating the split parts, constraints referring to the original feature are diverted to them. As last step of the evolution, the user interface is updated so that all split parts are selected if the original feature was previously selected. Merging can be performed for features and groups in two individual evolutions. Each of the 84 CHAPTER 4. A FRAMEWORK FOR EVOLUTIONS IN FEATUREMAPPER evolutions uses a precondition to check for an appropriate number of selected features. For the Merge Features evolution, it suffices to select a single feature if it was chosen to merge with the parent feature. In all other scenarios, the Merge Features and Merge Groups evolutions require at least two elements to be selected. In either case, it is checked that the selected elements are siblings in the feature tree. The Pull Up Feature evolution detaches a feature from its group and reattaches it as child of the group one logical level above the current one. The preconditions of the evolution check that the selected feature is at least two logical levels below the root feature to avoid the problems described in Section 3.1.1.6. The Remove Feature evolution deletes a selected feature from the feature tree. During the course of the evolution, all no longer required constraints are also deleted. For this purpose, the implementation keeps track of all referenced constraints of a feature. This ensures that only the constraints affected by the evolution that are no longer used are removed while leaving all other constraints unchanged even if no feature should reference them. The Remove Feature and Owned Assets evolution builds upon Remove Feature. It reuses the functionality to delete a selected feature from the problem space and adds support to delete owned solution space assets. In Section 3.1.1.8, a definition was provided for which criteria have to be met to consider a solution space element as being an owned asset. This definition is applied to locate the respective realization artifacts. Furthermore, the owned assets are analyzed to find UML elements that participate in associations. As the owned assets are to be deleted, the dependent associations can be deleted as well as they would be rendered invalid if one of their targets ceases to exist. The subsequent remapping is performed in accordance with Section 3.4.1 as a mixture of feature and object remapping steps. This type of remapping is exemplary for interspatial evolutions of the second degree, which affect problem and solution space simultaneously. Some of the more complex evolutions described in this section require a user interface to allow interaction with users. In particular, the evolutions Insert Feature, Duplicate Feature, Split Feature and Merge Features come with dialog pages dedicated to receiving configuration parameters. In Figure 4.5, an overview of the respective classes is shown. Figure 4.5: Parameter pages for the problem space evolutions requiring user input. AbstractParameterPageParameterPage DuplicateFeatureParameterPage MergeFeaturesParameterPage SplitFeatureParameterPage ModelRefactoringWizardPage InsertFeatureParameterPage 4.2. IMPLEMENTATION 85 The common base class for the user input dialog pages for problem space evolutions is the class AbstractParameterPage. It inherits from the class ModelRefactoringWizardPage provided by Refactory, which allows adding custom pages to the refactoring wizard. The completed wizard pages are passed as parameters to post processors of a refactoring. In the concrete case of problem space evolutions, this means that the parameter pages are passed to the evolution adapters, which then convert the contained values to parameters for their evolution. For example, this mechanism is used to pass a new name for a duplicated feature entered by a user to the Duplicate Feature evolution. It is worth noting that the parameter pages for problem space evolutions are provided in the package org.featuremapper.evolution.evolutions.problemspace.parameterpages. This package is part of the evolution subsystem rather than the UI system even though it clearly contains classes that might justify placing it in the latter. However, it was decided that the ties to the evolutions are much stronger than those to the rest of the user interface. In consequence, evolutions and their parameter pages are perceived as a functional unit that should not be broken up. Hence, evolutions and their parameter pages are both part of the evolution subsystem. 4.2.1.2 Implementation of Evolutions in the Solution Space Evolutions in the solution space have to be able to target many different types of models. Within this thesis, UML diagrams, Java source code and DocBooklet documents are used as an example. However, the approach could be extended to target arbitrary Ecore-based models. To make evolutions widely applicable, it seems prudent to exploit the generic modification mechanism of Refactory. For one, this can be done by specifying the steps for the evolution directly in a refactoring specification and then adding remapping support where necessary. Furthermore, there is also the option to perform the changes of an evolution and the subsequent remapping directly in Java code. This option has the benefits that more complex modifications can be performed and that remapping is easier as all relevant objects are directly available. Therefore, evolutions of this thesis favor the second approach. Explanations on how to implement generic refactoring specifications can be found in [Rei10] and instructions on how to make them suitable for the use in software product lines are presented in Section 4.3.2. The classes required to implement evolutions for the solution space in source code are introduced in the following paragraphs. The base class for all source code evolutions in the solution space is AbstractSolutionSpaceEvolution. It was designed to feature largely equivalent structures as its problem space counterpart AbstractProblemSpaceEvolution. In detail, the solution space evolution uses the same five steps for evolution as in the problem space (see Listing 4.4). The functionality and purpose of these methods has already been explained in the section on the implementation of problem space evolutions. However, the solution space employs one further method for evolution called updateSolutionSpace(). It is used to populate the changes made during the evolution to the data structures held by FeatureMapper. There is one elementary reason for why this method is only required in the solution space. FeatureMapper owns the feature model in the problem space but not the realization artifacts of the solution space. This means that the memory object held for the feature tree is also the very same instance that is being evolved. Thus, the modifications are populated automatically. However, solution space models are opened in a separate editor, which holds its own memory instance of the model. Hence, when changes are 86 CHAPTER 4. A FRAMEWORK FOR EVOLUTIONS IN FEATUREMAPPER Listing 4.5: Java source code excerpt from AbstractSolutionSpaceEvolution showing the six steps required for solution space evolutions. checkPreconditions(); evolve(); if (!getIsPreviewMode()) { remap(); updateSolutionSpace(); saveMappingModel(); updateUI(); } performed on the instance of the editor, they are not automatically reflected in the instance held by FeatureMapper. Due to this fact, the two instances of the same solution space model are in a different state. This causes problems for the consistency of the product line. As remedy, the affected solution space references of FeatureMapper are refreshed directly after the evolution by unloading and then reloading the respective models. After that, the instances of the solution space model held by FeatureMapper and the respective editor are synchronized again. The six steps for solution space evolutions are shown in Listing 4.5 as a Java source code fragment. The majority of the concrete solution space evolutions builds upon this structure and uses AbstractSolutionSpaceEvolution as base class. However, there are also a number of specializations of the class that represent generic solution space evolutions in source code that can be applied to a particular model merely by providing an adequate role mapping. An overview of the generic solution space evolutions is provided in Figure 4.6. Figure 4.6: UML diagram of the classes for generic evolutions in the solution space. MoveXTowardsBackEvolution MoveXTowardsFrontEvolution

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Variability and Evolution in Model-based Engineering of Embedded Systems

Abstract: In this paper, we report on techniques for variability and evolution in Model-based Engineering of Embedded Systems. The techniques are based on an integration of domain-specific languages for embedded systems with model-driven techniques for Software Product Lines. In particular, we discuss (1) product configuration with interactive tools, (2) product derivation with model transforma...

متن کامل

Case Study on Systematic Functional Decomposition in a Product Line using Aspect Oriented Software Development

Systematic configuration management is important for successful software product lines. We can use aspect oriented software development to decompose software product lines based on features that can ease configuration management. In this paper, we present a military maintenance product line that employs such strategy. In particular, we employed a specific approach, feature based modeling (FBM),...

متن کامل

FOOM - Feature-based Object Oriented Modeling: Implementation of a Process to extract and extend Software Product Line Architecture

Using a product line approach to software development and evolution requires much more than a re-use program: it requires the implementation of a common architecture across all members of the product family. FOOM represents a synthesis of FODA (Feature Oriented Domain Analysis) and Horseshoe models. It includes Object Oriented approach to Product Line Family architecture. It focuses on identify...

متن کامل

A Quantitative Assessment of Aspectual Feature Modules for Evolving Software Product Lines

Feature-Oriented Programming (FOP) and Aspect-Oriented Programming (AOP) are programming techniques based on composition mechanisms, called refinements and aspects, respectively. These techniques are assumed to be good variability mechanisms for implementing Software Product Lines (SPLs). Aspectual Feature Modules (AFM) is an approach that combines advantages of feature modules and aspects to i...

متن کامل

A quantitative and qualitative assessment of aspectual feature modules for evolving software product lines

Feature-Oriented Programming (FOP) and Aspect-Oriented Programming (AOP) are programming techniques based on composition mechanisms, called refinements and aspects, respectively. These techniques are assumed to be good variability mechanisms for implementing Software Product Lines (SPLs). Aspectual Feature Modules (AFM) is an approach that combines advantages of feature modules and aspects to i...

متن کامل

Feature-Based Composition of Software Architectures

In Software Product Lines variability refers to the definition and utilization of differences between several products. Feature Diagrams (FD) are a well-known approach to express variability, and can be used to automate the derivation process. Nevertheless, this may be highly complex due to possible interactions between selected features and the artifacts realizing them. Deriving concrete produ...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2011